//#include "acou_model.h"
#include "feature_params.h"

uint16_t melfiter0[3] = { 16718,61842,25917, };
uint16_t melfiter1[3] = { 39618,49814,9724, };
uint16_t melfiter2[3] = { 15721,55811,36606, };
uint16_t melfiter3[3] = { 28929,64826,28759, };
uint16_t melfiter4[4] = { 709,36776,59394,25589, };
uint16_t melfiter5[4] = { 6141,39946,58347,26536, };
uint16_t melfiter6[5] = { 7188,38999,61172,31134,1910, };
uint16_t melfiter7[5] = { 4363,34401,63625,38992,11271, };
uint16_t melfiter8[4] = { 26543,54264,49779,23414, };
uint16_t melfiter9[5] = { 15756,42121,63213,38076,13513, };
uint16_t melfiter10[6] = { 2322,27459,52022,55031,31538,8545, };
uint16_t melfiter11[6] = { 10504,33997,56990,51568,29516,7906, };
uint16_t melfiter12[6] = { 13967,36019,57629,52256,31479,11094, };
uint16_t melfiter13[6] = { 13279,34056,54441,56623,36982,17691, };
uint16_t melfiter14[7] = { 8912,28553,47844,64275,45651,27343,9341, };
uint16_t melfiter15[8] = { 1260,19884,38192,56194,57170,39750,22606,5731, };
uint16_t melfiter16[8] = { 8365,25785,42929,59804,54651,38288,22169,6289, };
uint16_t melfiter17[8] = { 10884,27247,43366,59246,56173,40746,25537,10540, };
uint16_t melfiter18[9] = { 9362,24789,39998,54995,61283,46692,32295,18088,4066, };
uint16_t melfiter19[10] = { 4252,18843,33240,47447,61469,55758,42092,28596,15267,2101, };
uint16_t melfiter20[10] = { 9777,23443,36939,50268,63434,54628,41776,29075,16522,4113, };
uint16_t melfiter21[10] = { 10907,23759,36460,49013,61422,57381,45251,33257,21394,9661, };
uint16_t melfiter22[11] = { 8154,20284,32278,44141,55874,63588,52105,40742,29498,18370,7356, };
uint16_t melfiter23[12] = { 1947,13430,24793,36037,47165,58179,61988,51194,40507,29925,19446,9067, };
uint16_t melfiter24[13] = { 3547,14341,25028,35610,46089,56468,64323,54141,44054,34060,24158,14346,4623, };
uint16_t melfiter25[14] = { 1212,11394,21481,31475,41377,51189,60912,60522,50971,41504,32119,22815,13591,4445, };
uint16_t melfiter26[14] = { 5013,14564,24031,33416,42720,51944,61090,60911,51918,42999,34153,25379,16676,8043, };
uint16_t melfiter27[15] = { 4624,13617,22536,31382,40156,48859,57492,65013,56516,48085,39719,31418,23181,15006,6892, };
uint16_t melfiter28[17] = { 522,9019,17450,25816,34117,42354,50529,58643,64374,56381,48446,40569,32750,24987,17279,9626,2027, };
uint16_t melfiter29[18] = { 1161,9154,17089,24966,32785,40548,48256,55909,63508,60016,52523,45081,37690,30350,23059,15818,8624,1478, };
uint16_t melfiter30[18] = { 5519,13012,20454,27845,35185,42476,49717,56911,64057,59914,52862,45856,38894,31978,25105,18276,11490,4746, };
uint16_t melfiter31[19] = { 5621,12673,19679,26641,33557,40430,47259,54045,60789,63580,56919,50300,43721,37182,30682,24221,17799,11415,5068, };
uint16_t melfiter32[21] = { 1955,8616,15235,21814,28353,34853,41314,47736,54120,60467,64294,58021,51784,45584,39418,33288,27193,21131,15104,9110,3149, };
uint16_t melfiter33[22] = { 1241,7514,13751,19951,26117,32247,38342,44404,50431,56425,62386,62756,56861,50997,45165,39365,33595,27857,22148,16470,10822,5203, };
uint16_t melfiter34[24] = { 2779,8674,14538,20370,26170,31940,37678,43387,49065,54713,60332,65148,59586,54054,48550,43073,37624,32203,26809,21442,16101,10786,5498,235, };
uint16_t melfiter35[25] = { 387,5949,11481,16985,22462,27911,33332,38726,44093,49434,54749,60037,65300,60533,55322,50135,44973,39836,34723,29634,24570,19528,14511,9516,4545, };
uint16_t melfiter36[26] = { 5002,10213,15400,20562,25699,30812,35901,40965,46007,51024,56019,60990,65131,60205,55302,50420,45561,40723,35907,31113,26339,21587,16856,12145,7454,2784, };
uint16_t melfiter37[29] = { 404,5330,10233,15115,19974,24812,29628,34422,39196,43948,48679,53390,58081,62751,63670,59040,54430,49839,45268,40716,36184,31670,27175,22699,18242,13802,9381,4978,593, };
uint16_t melfiter38[30] = { 1865,6495,11105,15696,20267,24819,29351,33865,38360,42836,47293,51733,56154,60557,64942,61761,57411,53079,48764,44466,40186,35922,31675,27445,23231,19033,14852,10687,6539,2406, };
uint16_t melfiter39[31] = { 3774,8124,12456,16771,21069,25349,29613,33860,38090,42304,46502,50683,54848,58996,63129,63823,59722,55636,51565,47510,43470,39445,35435,31440,27459,23493,19542,15605,11683,7774,3880, };

const fbank_cfg_t FBANK_FILTERS[_NUM_MEL_BINS] = {
    {1,4,melfiter0},
    {3,6,melfiter1},
    {4,7,melfiter2},
    {6,9,melfiter3},
    {7,11,melfiter4},
    {9,13,melfiter5},
    {11,16,melfiter6},
    {13,18,melfiter7},
    {16,20,melfiter8},
    {18,23,melfiter9},
    {20,26,melfiter10},
    {23,29,melfiter11},
    {26,32,melfiter12},
    {29,35,melfiter13},
    {32,39,melfiter14},
    {35,43,melfiter15},
    {39,47,melfiter16},
    {43,51,melfiter17},
    {47,56,melfiter18},
    {51,61,melfiter19},
    {56,66,melfiter20},
    {61,71,melfiter21},
    {66,77,melfiter22},
    {71,83,melfiter23},
    {77,90,melfiter24},
    {83,97,melfiter25},
    {90,104,melfiter26},
    {97,112,melfiter27},
    {104,121,melfiter28},
    {112,130,melfiter29},
    {121,139,melfiter30},
    {130,149,melfiter31},
    {139,160,melfiter32},
    {149,171,melfiter33},
    {160,184,melfiter34},
    {171,196,melfiter35},
    {184,210,melfiter36},
    {196,225,melfiter37},
    {210,240,melfiter38},
    {225,256,melfiter39},
};

// U16Q16
const uint16_t povey_win[_WIN_SIZE] = {
0,17,56,112,183,267,365,474,595,727,869,1021,1184,1356,1537,1728,1927,2135,2352,2576,2809,3050,3299,3555,3818,4089,4367,4652,4944,5243,5548,5860,6178,6503,6833,7170,7512,7860,8214,8573,8937,9307,9682,10062,10447,10837,11231,11630,12034,12442,12854,13270,13691,14115,14543,14975,15410,15849,16291,16736,17185,17637,18091,18549,19009,19471,19937,20404,20874,21346,21821,22297,22775,23254,23736,24219,24703,25189,25675,26163,26652,27142,27633,28124,28616,29108,29601,30094,30587,31080,31573,32066,32559,33051,33543,34035,34525,35015,35504,35992,36479,36965,37449,37932,38414,38894,39372,39849,40324,40797,41267,41736,42202,42667,43128,43587,44044,44497,44948,45397,45842,46284,46723,47158,47591,48020,48445,48867,49285,49699,50110,50517,50920,51318,51713,52103,52489,52871,53248,53620,53988,54352,54710,55064,55413,55757,56096,56430,56759,57082,57400,57713,58021,58323,58619,58910,59196,59475,59749,60018,60280,60536,60787,61031,61270,61502,61728,61948,62162,62370,62571,62766,62954,63137,63312,63481,63644,63800,63950,64093,64229,64359,64482,64598,64708,64811,64907,64996,65079,65154,65223,65285,65340,65389,65430,65465,65492,65513,65527,65534,65534,65527,65513,65492,65465,65430,65389,65340,65285,65223,65154,65079,64996,64907,64811,64708,64598,64482,64359,64229,64093,63950,63800,63644,63481,63312,63137,62954,62766,62571,62370,62162,61948,61728,61502,61270,61031,60787,60536,60280,60018,59749,59475,59196,58910,58619,58323,58021,57713,57400,57082,56759,56430,56096,55757,55413,55064,54710,54352,53988,53620,53248,52871,52489,52103,51713,51318,50920,50517,50110,49699,49285,48867,48445,48020,47591,47158,46723,46284,45842,45397,44948,44497,44044,43587,43128,42667,42202,41736,41267,40797,40324,39849,39372,38894,38414,37932,37449,36965,36479,35992,35504,35015,34525,34035,33543,33051,32559,32066,31573,31080,30587,30094,29601,29108,28616,28124,27633,27142,26652,26163,25675,25189,24703,24219,23736,23254,22775,22297,21821,21346,20874,20404,19937,19471,19009,18549,18091,17637,17185,16736,16291,15849,15410,14975,14543,14115,13691,13270,12854,12442,12034,11630,11231,10837,10447,10062,9682,9307,8937,8573,8214,7860,7512,7170,6833,6503,6178,5860,5548,5243,4944,4652,4367,4089,3818,3555,3299,3050,2809,2576,2352,2135,1927,1728,1537,1356,1184,1021,869,727,595,474,365,267,183,112,56,17,0};

const short povey_win_signed[_WIN_SIZE] = {
0,9,28,56,92,134,183,237,298,364,435,511,592,678,769,864,964,1068,1176,1288,1405,1525,1650,1778,1909,2045,2184,2326,2472,2622,2774,2930,3089,3252,3417,3585,3756,3930,4107,4287,4469,4654,4841,5031,5224,5419,5616,5815,6017,6221,6427,6635,6846,7058,7272,7488,7705,7925,8146,8368,8593,8819,9046,9275,9505,9736,9969,10202,10437,10673,10911,11149,11388,11627,11868,12110,12352,12595,12838,13082,13326,13571,13817,14062,14308,14554,14801,15047,15294,15540,15787,16033,16280,16526,16772,17018,17263,17508,17752,17996,18240,18483,18725,18966,19207,19447,19686,19925,20162,20399,20634,20868,21101,21334,21564,21794,22022,22249,22474,22699,22921,23142,23362,23579,23796,24010,24223,24434,24643,24850,25055,25259,25460,25659,25857,26052,26245,26436,26624,26810,26994,27176,27355,27532,27707,27879,28048,28215,28380,28541,28700,28857,29011,29162,29310,29455,29598,29738,29875,30009,30140,30268,30394,30516,30635,30751,30864,30974,31081,31185,31286,31383,31477,31569,31656,31741,31822,31900,31975,32047,32115,32180,32241,32299,32354,32406,32454,32498,32540,32577,32612,32643,32670,32695,32715,32733,32746,32757,32764,32767,32767,32764,32757,32746,32733,32715,32695,32670,32643,32612,32577,32540,32498,32454,32406,32354,32299,32241,32180,32115,32047,31975,31900,31822,31741,31656,31569,31477,31383,31286,31185,31081,30974,30864,30751,30635,30516,30394,30268,30140,30009,29875,29738,29598,29455,29310,29162,29011,28857,28700,28541,28380,28215,28048,27879,27707,27532,27355,27176,26994,26810,26624,26436,26245,26052,25857,25659,25460,25259,25055,24850,24643,24434,24223,24010,23796,23579,23362,23142,22921,22699,22474,22249,22022,21794,21564,21334,21101,20868,20634,20399,20162,19925,19686,19447,19207,18966,18725,18483,18240,17996,17752,17508,17263,17018,16772,16526,16280,16033,15787,15540,15294,15047,14801,14554,14308,14062,13817,13571,13326,13082,12838,12595,12352,12110,11868,11627,11388,11149,10911,10673,10437,10202,9969,9736,9505,9275,9046,8819,8593,8368,8146,7925,7705,7488,7272,7058,6846,6635,6427,6221,6017,5815,5616,5419,5224,5031,4841,4654,4469,4287,4107,3930,3756,3585,3417,3252,3089,2930,2774,2622,2472,2326,2184,2045,1909,1778,1650,1525,1405,1288,1176,1068,964,864,769,678,592,511,435,364,298,237,183,134,92,56,28,9,0 };










